/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package Trabalho3.RegrasPasswordChecker01;

import Trabalho3.RuleFactory;

/**
 *
 * @author geraldo
 */
public class RegraTamanho implements RuleFactory{
    
    String password;

    public RegraTamanho(String password) {
        this.password = password;
    }
    
    
    @Override
    public int calcularRegra(){
        if (password.length() < 5) {
            return 3;
        } else if (password.length() > 4 && password.length() < 8) {
            return 6;
        } else if (password.length() > 7 && password.length() < 16) {
            return 12;
        } else if (password.length() > 15) {
            return 18;
        }
        return 0;
    }
    
}
